function MyProxy ( target, handle ) {
    // 第一步：将对象进行深拷贝
    let _target = deepClone( target )
    Object.keys(_target).forEach( key => {
        Object.defineProperty(_target, key, {
            get() {
                return handle.get && handle.get(target, key)
            },
            set(newValue) {
                handle.set && handle.set(target, key, newValue)
            }
        })
    } )
    return _target

    function deepClone ( org, tar ) {
        
        var tar = tar || {},
            toStr = Object.prototype.toString
        
        for ( var key in org ) {
            if (org.hasOwnProperty(key)) {
                if (typeof(org[key]) === 'object' && org[key] !== null) {
                    if (toStr.call(org[key]) === '[object Array]') {
                        tar[key] = []
                    } else {
                        tar[key] ={}
                    }
                    // 简洁版
                    // tar[key] = toStr.call(org[key]) === '[object Array]' ? [] : {}
                    deepClone(org[key], tar[key])
                } else {
                    tar[key] = org[key]
                }
            }
        }
        return tar
    }
}

let target = {
    a: 1,
    b: [
        {
            b1: 2
        },
        {b2: 3}
    ],
    c: {
        c1: 4
    }
}
let proxy = new MyProxy(target, {
    get(target, prop) {
        return Reflect.get(target, prop)
    },
    set(target, prop, newValue) {
        const isSuccess = Reflect.set(target, prop, newValue)
        if (isSuccess) {
            console.log(`Set: ${prop} = ${newValue}`)
        }  
    }
})
console.log(proxy)
console.log(target)